package com.wwinsoft.framework.web.system;

import org.apache.commons.lang.StringUtils;
import org.apache.struts2.convention.annotation.Namespace;

import com.wwinsoft.framework.web.SimpleActionSupport;
import com.wwinsoft.modules.utils.web.struts2.Struts2Utils;

/**
 * @author: Tim.Chen
 * @since: 1.0
 */
@Namespace("/system")
public class ErrorAction extends SimpleActionSupport {

    public String execute() {
        String code = Struts2Utils.getParameter("code");
        if (StringUtils.isEmpty(code)) {
            return "500";
        }
        if ("403".equals(code)) {
            return "403";
        } else if ("404".equals(code)) {
            return "404";
        } else {
            return "500";
        }
    }
}
